package com.topisv.tms.entity.stock.instorage.pre;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;

import com.topisv.tms.entity.IdEntity;

/**
 * 商家入库预约单实体
 *  Date          Author       Version       Description
 * ----------------------------------------------------------
 *  2014-6-27      CC            1.0           Create
 */
@Entity
@Table(name = "instorage_bill_pre")
public class InstorageBillPre extends IdEntity {
	private static final long serialVersionUID = 1L;
	private String customerCode;// 商家编码
	private String inwarehouseCode;// 入库仓库编码
	private String billCode;// 预约单号
	private Integer boxNum;// 箱子数量
	private Integer skuNum;// SKU数量
	private Integer goodsNum;// 商品数量
	private String carNo;// 车牌号
	private String orderStatus;// 入库订单状态
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date preSendTm;// 预计发货时间
	private Date createTm;// 创建时间
	private Date modifyTm;// 修改时间
	private String createCode; // 创建人
	private String remark;// 备注
	private String customerOrderNo;// 客户的订单号
	private String subCustomerCode;// 分销的客户代码
	private String cusWarehouseCode;// 客户仓库编码
	private String billType;//预约入库单类型 (SCRK=生产入库，LYRK=领用入库，CCRK=残次品入库，CGRK=采购入库，DBRK=调拨入库, QTRK=其他入库，B2BRK=B2B入库)
	private String oldCusOrderNo;// 原始单号
	private String sourceOrdNo;// 来源单号
	private String expressNo;// 快递单号
	private String errorFlg;// 是否破损
	private String returngoodStatus; // 是否与退货池匹配 1:是 0:否
	private List<InstorageBillItemPre> billItem;
	private List<PreInBill> preInBills;

	public String getCustomerCode() {
		return customerCode;
	}

	public void setCustomerCode(String customerCode) {
		this.customerCode = customerCode;
	}

	public String getInwarehouseCode() {
		return inwarehouseCode;
	}

	public void setInwarehouseCode(String inwarehouseCode) {
		this.inwarehouseCode = inwarehouseCode;
	}

	public Integer getBoxNum() {
		return boxNum;
	}

	public void setBoxNum(Integer boxNum) {
		this.boxNum = boxNum;
	}

	public Integer getSkuNum() {
		return skuNum;
	}

	public void setSkuNum(Integer skuNum) {
		this.skuNum = skuNum;
	}

	public Integer getGoodsNum() {
		return goodsNum;
	}

	public void setGoodsNum(Integer goodsNum) {
		this.goodsNum = goodsNum;
	}

	public String getCarNo() {
		return carNo;
	}

	public void setCarNo(String carNo) {
		this.carNo = carNo;
	}

	public String getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(String orderStatus) {
		this.orderStatus = orderStatus;
	}

	public Date getPreSendTm() {
		return preSendTm;
	}

	public void setPreSendTm(Date preSendTm) {
		this.preSendTm = preSendTm;
	}

	public Date getCreateTm() {
		return createTm;
	}

	public void setCreateTm(Date createTm) {
		this.createTm = createTm;
	}

	public Date getModifyTm() {
		return modifyTm;
	}

	public void setModifyTm(Date modifyTm) {
		this.modifyTm = modifyTm;
	}

	public String getCreateCode() {
		return createCode;
	}

	public void setCreateCode(String createCode) {
		this.createCode = createCode;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getBillCode() {
		return billCode;
	}

	public void setBillCode(String billCode) {
		this.billCode = billCode;
	}

	public String getCustomerOrderNo() {
		return customerOrderNo;
	}

	public void setCustomerOrderNo(String customerOrderNo) {
		this.customerOrderNo = customerOrderNo;
	}

	public String getBillType() {
		return billType;
	}

	public void setBillType(String billType) {
		this.billType = billType;
	}

	public String getSubCustomerCode() {
		return subCustomerCode;
	}

	public void setSubCustomerCode(String subCustomerCode) {
		this.subCustomerCode = subCustomerCode;
	}

	@Transient
	public List<InstorageBillItemPre> getBillItem() {
		return billItem;
	}

	public void setBillItem(List<InstorageBillItemPre> billItem) {
		this.billItem = billItem;
	}

	public String getCusWarehouseCode() {
		return cusWarehouseCode;
	}

	public void setCusWarehouseCode(String cusWarehouseCode) {
		this.cusWarehouseCode = cusWarehouseCode;
	}

	public String getOldCusOrderNo() {
		return oldCusOrderNo;
	}

	public void setOldCusOrderNo(String oldCusOrderNo) {
		this.oldCusOrderNo = oldCusOrderNo;
	}

	public String getExpressNo() {
		return expressNo;
	}

	public void setExpressNo(String expressNo) {
		this.expressNo = expressNo;
	}

	public String getErrorFlg() {
		return errorFlg;
	}

	public void setErrorFlg(String errorFlg) {
		this.errorFlg = errorFlg;
	}

	public String getSourceOrdNo() {
		return sourceOrdNo;
	}

	public void setSourceOrdNo(String sourceOrdNo) {
		this.sourceOrdNo = sourceOrdNo;
	}

	public String getReturngoodStatus() {
		return returngoodStatus;
	}

	public void setReturngoodStatus(String returngoodStatus) {
		this.returngoodStatus = returngoodStatus;
	}

	@OneToMany(cascade = { CascadeType.ALL })
	@JoinColumn(name="preBillId")
	public List<PreInBill> getPreInBills() {
		return preInBills;
	}

	public void setPreInBills(List<PreInBill> preInBills) {
		this.preInBills = preInBills;
	}

	private String orderCreateTime;			//订单创建时间
	private String expectEndTime;	//最迟预期到货时间
	private String logisticsCode;			//快递公司编码
	private String logisticsName;			//快递公司名称
	private String orderFlag;		//用字符串格式来表示订单标记列表：比如VISIT^ SELLER_AFFORD^SYNC_RETURN_BILL 等, 中间用“^”来隔开 订单标记list (所有字母全部大写) ： VISIT=上门；SELLER_AFFORD=是否卖家承担运费 (默认是) ；SYNC_RETURN_BILL=同时退回发票；
	private String returnReason;		//退货原因
	
	public String getOrderCreateTime() {
		return orderCreateTime;
	}

	public void setOrderCreateTime(String orderCreateTime) {
		this.orderCreateTime = orderCreateTime;
	}


	public String getExpectEndTime() {
		return expectEndTime;
	}

	public void setExpectEndTime(String expectEndTime) {
		this.expectEndTime = expectEndTime;
	}

	public String getLogisticsCode() {
		return logisticsCode;
	}

	public void setLogisticsCode(String logisticsCode) {
		this.logisticsCode = logisticsCode;
	}

	public String getLogisticsName() {
		return logisticsName;
	}

	public void setLogisticsName(String logisticsName) {
		this.logisticsName = logisticsName;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String getOrderFlag() {
		return orderFlag;
	}

	public void setOrderFlag(String orderFlag) {
		this.orderFlag = orderFlag;
	}

	public String getReturnReason() {
		return returnReason;
	}

	public void setReturnReason(String returnReason) {
		this.returnReason = returnReason;
	}
	
}
